﻿
using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using InnovaApp.Layers.DomainLayer;

namespace InnovaApp.Layers.DataLayer
{
    public interface IRepository<T> where T : class
    {    
		#region	Methods
	
        T GetById(int id);
        IEnumerable<T> GetAll();
        IEnumerable<T> Query(Expression<Func<T, bool>> filter);        
        void Add(T entity);
        void Remove(T entity);   
		
		#endregion
    }
	
	public abstract class Repository<T> : IRepository<T>
                                  where T : class
    {
    	#region Members
    	protected readonly IObjectSet<T> _objectSet;

    	#endregion

    	#region Ctor

    	public Repository(DataRepositories repository)
    	{
      		_objectSet = repository._context.CreateObjectSet<T>();
			repository.Saved += new EventHandler(this.OnSave);
    	}
		


    	#endregion

		protected abstract void OnSave(object sender, EventArgs arg);


    	#region IRepository<T> Members

    	public IEnumerable<T> GetAll()
    	{
      		return _objectSet;
    	}

    	public abstract T GetById(int id);

    	public IEnumerable<T> Query(Expression<Func<T, bool>> filter)
    	{
      		return _objectSet.Where(filter);
    	}

    	public void Add(T entity)
    	{
     	 	_objectSet.AddObject(entity);
    	}

    	public void Remove(T entity)
    	{
      		_objectSet.DeleteObject(entity);
    	}

    	#endregion
  	}

	
	public partial class AddressType_Rep : Repository<AddressType>
	{
		#region Ctor

		public AddressType_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<AddressType,AddressType>> _entityToSync = new List<Tuple<AddressType,AddressType>>();

		#region Methods
 				
		public override AddressType GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(AddressType entity)
		{
			AddressType efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new AddressType();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new AddressType();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< AddressType,AddressType>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						efEntity.isCorrespondence =  entity.isCorrespondence; 
						efEntity.isDelivery =  entity.isDelivery; 
						efEntity.isBilling =  entity.isBilling; 
						
			//Navigation Properties
						//efEntity.Contact_ContactAddress_AddressType =  entity.Contact_ContactAddress_AddressType; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Article_Rep : Repository<Article>
	{
		#region Ctor

		public Article_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Article,Article>> _entityToSync = new List<Tuple<Article,Article>>();

		#region Methods
 				
		public override Article GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Article entity)
		{
			Article efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Article();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Article();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Article,Article>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_ManagedContent =  entity.FK_ManagedContent; 
						efEntity.ResumeImage =  entity.ResumeImage; 
						efEntity.ResumeTitle =  entity.ResumeTitle; 
						efEntity.ArticleTitle =  entity.ArticleTitle; 
						efEntity.DirectURL =  entity.DirectURL; 
						efEntity.ArticleNameUrlFormatted =  entity.ArticleNameUrlFormatted; 
						efEntity.Description =  entity.Description; 
						efEntity.Keywords =  entity.Keywords; 
						efEntity.Robots =  entity.Robots; 
						efEntity.ReadyToPublish =  entity.ReadyToPublish; 
						efEntity.IndexingCategory =  entity.IndexingCategory; 
						efEntity.IsActive =  entity.IsActive; 
						efEntity.PublicationDate =  entity.PublicationDate; 
						efEntity.ExpirationDate =  entity.ExpirationDate; 
						efEntity.LastBuildDate =  entity.LastBuildDate; 
						efEntity.DateVersion =  entity.DateVersion; 
						
			//Navigation Properties
						//efEntity.ArticleComment =  entity.ArticleComment; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class ArticleComment_Rep : Repository<ArticleComment>
	{
		#region Ctor

		public ArticleComment_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<ArticleComment,ArticleComment>> _entityToSync = new List<Tuple<ArticleComment,ArticleComment>>();

		#region Methods
 				
		public override ArticleComment GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(ArticleComment entity)
		{
			ArticleComment efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new ArticleComment();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new ArticleComment();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< ArticleComment,ArticleComment>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_ArticleComment =  entity.FK_ArticleComment; 
						efEntity.FK_Article =  entity.FK_Article; 
						efEntity.FK_ManagedContent =  entity.FK_ManagedContent; 
						efEntity.FK_Contact =  entity.FK_Contact; 
						efEntity.Likes =  entity.Likes; 
						efEntity.Unlike =  entity.Unlike; 
						efEntity.Read =  entity.Read; 
						
			//Navigation Properties
						//efEntity.ArticleComment1 =  entity.ArticleComment1; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class CalendarTimeZones_Rep : Repository<CalendarTimeZones>
	{
		#region Ctor

		public CalendarTimeZones_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<CalendarTimeZones,CalendarTimeZones>> _entityToSync = new List<Tuple<CalendarTimeZones,CalendarTimeZones>>();

		#region Methods
 				
		public override CalendarTimeZones GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(CalendarTimeZones entity)
		{
			CalendarTimeZones efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new CalendarTimeZones();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new CalendarTimeZones();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< CalendarTimeZones,CalendarTimeZones>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.CountryCode =  entity.CountryCode; 
						efEntity.Coordinates =  entity.Coordinates; 
						efEntity.TimeZone =  entity.TimeZone; 
						efEntity.Comments =  entity.Comments; 
						efEntity.UTCoffset =  entity.UTCoffset; 
						efEntity.UTC_DST_offset =  entity.UTC_DST_offset; 
						efEntity.Notes =  entity.Notes; 
						
			//Navigation Properties
						//efEntity.Contact =  entity.Contact; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Competency_Rep : Repository<Competency>
	{
		#region Ctor

		public Competency_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Competency,Competency>> _entityToSync = new List<Tuple<Competency,Competency>>();

		#region Methods
 				
		public override Competency GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Competency entity)
		{
			Competency efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Competency();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Competency();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Competency,Competency>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						
			//Navigation Properties
						//efEntity.Contact_Competency =  entity.Contact_Competency; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Contact_Rep : Repository<Contact>
	{
		#region Ctor

		public Contact_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Contact,Contact>> _entityToSync = new List<Tuple<Contact,Contact>>();

		#region Methods
 				
		public override Contact GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Contact entity)
		{
			Contact efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Contact();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Contact();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Contact,Contact>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Language =  entity.FK_Language; 
						efEntity.FK_InnoAppUser =  entity.FK_InnoAppUser; 
						efEntity.FK_Genre =  entity.FK_Genre; 
						efEntity.FK_CalendarTimeZones =  entity.FK_CalendarTimeZones; 
						efEntity.FirstName =  entity.FirstName; 
						efEntity.LastName =  entity.LastName; 
						efEntity.BirthDate =  entity.BirthDate; 
						efEntity.IconPath =  entity.IconPath; 
						efEntity.ImagePath =  entity.ImagePath; 
						efEntity.GoogleMapLat =  entity.GoogleMapLat; 
						efEntity.GoogleMapLng =  entity.GoogleMapLng; 
						
			//Navigation Properties
						//efEntity.ArticleComment =  entity.ArticleComment; 
						//efEntity.Contact_ContactAddress =  entity.Contact_ContactAddress; 
						//efEntity.Contact_Competency =  entity.Contact_Competency; 
						//efEntity.Contact_TelecomType =  entity.Contact_TelecomType; 
						//efEntity.Order =  entity.Order; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Contact_Competency_Rep : Repository<Contact_Competency>
	{
		#region Ctor

		public Contact_Competency_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Contact_Competency,Contact_Competency>> _entityToSync = new List<Tuple<Contact_Competency,Contact_Competency>>();

		#region Methods
 				
		public override Contact_Competency GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Contact_Competency entity)
		{
			Contact_Competency efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Contact_Competency();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Contact_Competency();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Contact_Competency,Contact_Competency>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Competency =  entity.FK_Competency; 
						efEntity.FK_Contact =  entity.FK_Contact; 
						efEntity.SortIndex =  entity.SortIndex; 
						efEntity.YearsOfExperience =  entity.YearsOfExperience; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Contact_ContactAddress_Rep : Repository<Contact_ContactAddress>
	{
		#region Ctor

		public Contact_ContactAddress_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Contact_ContactAddress,Contact_ContactAddress>> _entityToSync = new List<Tuple<Contact_ContactAddress,Contact_ContactAddress>>();

		#region Methods
 				
		public override Contact_ContactAddress GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Contact_ContactAddress entity)
		{
			Contact_ContactAddress efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Contact_ContactAddress();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Contact_ContactAddress();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Contact_ContactAddress,Contact_ContactAddress>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_ContactAddress =  entity.FK_ContactAddress; 
						efEntity.FK_Contact =  entity.FK_Contact; 
						efEntity.AddressLabel =  entity.AddressLabel; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						//efEntity.Contact_ContactAddress_AddressType =  entity.Contact_ContactAddress_AddressType; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Contact_ContactAddress_AddressType_Rep : Repository<Contact_ContactAddress_AddressType>
	{
		#region Ctor

		public Contact_ContactAddress_AddressType_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Contact_ContactAddress_AddressType,Contact_ContactAddress_AddressType>> _entityToSync = new List<Tuple<Contact_ContactAddress_AddressType,Contact_ContactAddress_AddressType>>();

		#region Methods
 				
		public override Contact_ContactAddress_AddressType GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Contact_ContactAddress_AddressType entity)
		{
			Contact_ContactAddress_AddressType efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Contact_ContactAddress_AddressType();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Contact_ContactAddress_AddressType();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Contact_ContactAddress_AddressType,Contact_ContactAddress_AddressType>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Contact_ContactAddress =  entity.FK_Contact_ContactAddress; 
						efEntity.FK_AddressType =  entity.FK_AddressType; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Contact_TelecomType_Rep : Repository<Contact_TelecomType>
	{
		#region Ctor

		public Contact_TelecomType_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Contact_TelecomType,Contact_TelecomType>> _entityToSync = new List<Tuple<Contact_TelecomType,Contact_TelecomType>>();

		#region Methods
 				
		public override Contact_TelecomType GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Contact_TelecomType entity)
		{
			Contact_TelecomType efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Contact_TelecomType();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Contact_TelecomType();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Contact_TelecomType,Contact_TelecomType>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Contact =  entity.FK_Contact; 
						efEntity.FK_TelecomType =  entity.FK_TelecomType; 
						efEntity.Value =  entity.Value; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class ContactAddress_Rep : Repository<ContactAddress>
	{
		#region Ctor

		public ContactAddress_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<ContactAddress,ContactAddress>> _entityToSync = new List<Tuple<ContactAddress,ContactAddress>>();

		#region Methods
 				
		public override ContactAddress GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(ContactAddress entity)
		{
			ContactAddress efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new ContactAddress();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new ContactAddress();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< ContactAddress,ContactAddress>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Address_1 =  entity.Address_1; 
						efEntity.Address_2 =  entity.Address_2; 
						efEntity.Address_3 =  entity.Address_3; 
						efEntity.ZipCode =  entity.ZipCode; 
						efEntity.Town =  entity.Town; 
						efEntity.Cedex =  entity.Cedex; 
						efEntity.Country =  entity.Country; 
						
			//Navigation Properties
						//efEntity.Contact_ContactAddress =  entity.Contact_ContactAddress; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class DeliveryMode_Rep : Repository<DeliveryMode>
	{
		#region Ctor

		public DeliveryMode_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<DeliveryMode,DeliveryMode>> _entityToSync = new List<Tuple<DeliveryMode,DeliveryMode>>();

		#region Methods
 				
		public override DeliveryMode GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(DeliveryMode entity)
		{
			DeliveryMode efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new DeliveryMode();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new DeliveryMode();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< DeliveryMode,DeliveryMode>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						//efEntity.Order =  entity.Order; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Genre_Rep : Repository<Genre>
	{
		#region Ctor

		public Genre_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Genre,Genre>> _entityToSync = new List<Tuple<Genre,Genre>>();

		#region Methods
 				
		public override Genre GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Genre entity)
		{
			Genre efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Genre();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Genre();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Genre,Genre>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						//efEntity.Contact =  entity.Contact; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class IndexingCategory_Rep : Repository<IndexingCategory>
	{
		#region Ctor

		public IndexingCategory_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<IndexingCategory,IndexingCategory>> _entityToSync = new List<Tuple<IndexingCategory,IndexingCategory>>();

		#region Methods
 				
		public override IndexingCategory GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(IndexingCategory entity)
		{
			IndexingCategory efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new IndexingCategory();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new IndexingCategory();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< IndexingCategory,IndexingCategory>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoAppDynamicSetting_Rep : Repository<InnoAppDynamicSetting>
	{
		#region Ctor

		public InnoAppDynamicSetting_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoAppDynamicSetting,InnoAppDynamicSetting>> _entityToSync = new List<Tuple<InnoAppDynamicSetting,InnoAppDynamicSetting>>();

		#region Methods
 				
		public override InnoAppDynamicSetting GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(InnoAppDynamicSetting entity)
		{
			InnoAppDynamicSetting efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new InnoAppDynamicSetting();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoAppDynamicSetting();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoAppDynamicSetting,InnoAppDynamicSetting>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_InnoApplication =  entity.FK_InnoApplication; 
						efEntity.SiteLayout =  entity.SiteLayout; 
						efEntity.Name =  entity.Name; 
						efEntity.Value =  entity.Value; 
						efEntity.ExpectedType =  entity.ExpectedType; 
						efEntity.Range_From =  entity.Range_From; 
						efEntity.Range_To =  entity.Range_To; 
						efEntity.Required =  entity.Required; 
						efEntity.DefaultValue =  entity.DefaultValue; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoApplication_Rep : Repository<InnoApplication>
	{
		#region Ctor

		public InnoApplication_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoApplication,InnoApplication>> _entityToSync = new List<Tuple<InnoApplication,InnoApplication>>();

		#region Methods
 				public InnoApplication GetById(Guid id)   
		{
			return _objectSet.SingleOrDefault(e => e.Id == id);
		}
		
				
		public override InnoApplication GetById(int id)   
		{
		 				//Implicit conversion
		return GetById(id);
				}

		public void AddUpdate(InnoApplication entity)
		{
			InnoApplication efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Guid))
			{
				efEntity = new InnoApplication();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoApplication();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoApplication,InnoApplication>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Language =  entity.FK_Language; 
						efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						efEntity.DenyRobotIndexing =  entity.DenyRobotIndexing; 
						
			//Navigation Properties
						//efEntity.LayoutMenu =  entity.LayoutMenu; 
						//efEntity.InnoAppDynamicSetting =  entity.InnoAppDynamicSetting; 
						//efEntity.InnoAppSettings =  entity.InnoAppSettings; 
						//efEntity.InnoAppSpecialBlockHTMLContent =  entity.InnoAppSpecialBlockHTMLContent; 
						//efEntity.InnoAppUser =  entity.InnoAppUser; 
						//efEntity.InnoRole =  entity.InnoRole; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoAppSettings_Rep : Repository<InnoAppSettings>
	{
		#region Ctor

		public InnoAppSettings_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoAppSettings,InnoAppSettings>> _entityToSync = new List<Tuple<InnoAppSettings,InnoAppSettings>>();

		#region Methods
 				
		public override InnoAppSettings GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(InnoAppSettings entity)
		{
			InnoAppSettings efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new InnoAppSettings();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoAppSettings();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoAppSettings,InnoAppSettings>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_InnoApplication =  entity.FK_InnoApplication; 
						efEntity.AccountActivationFromEmailAddress =  entity.AccountActivationFromEmailAddress; 
						efEntity.SiteLayout =  entity.SiteLayout; 
						efEntity.JQueryCornersRounded =  entity.JQueryCornersRounded; 
						efEntity.JQueryUITheme =  entity.JQueryUITheme; 
						efEntity.KendoUITheme =  entity.KendoUITheme; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoAppSpecialBlockHTMLContent_Rep : Repository<InnoAppSpecialBlockHTMLContent>
	{
		#region Ctor

		public InnoAppSpecialBlockHTMLContent_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoAppSpecialBlockHTMLContent,InnoAppSpecialBlockHTMLContent>> _entityToSync = new List<Tuple<InnoAppSpecialBlockHTMLContent,InnoAppSpecialBlockHTMLContent>>();

		#region Methods
 				
		public override InnoAppSpecialBlockHTMLContent GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(InnoAppSpecialBlockHTMLContent entity)
		{
			InnoAppSpecialBlockHTMLContent efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new InnoAppSpecialBlockHTMLContent();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoAppSpecialBlockHTMLContent();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoAppSpecialBlockHTMLContent,InnoAppSpecialBlockHTMLContent>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_InnoApplication =  entity.FK_InnoApplication; 
						efEntity.FK_Language =  entity.FK_Language; 
						efEntity.SameForAllLanguages =  entity.SameForAllLanguages; 
						efEntity.SiteLayout =  entity.SiteLayout; 
						efEntity.BlockSelector =  entity.BlockSelector; 
						efEntity.HTMLContent =  entity.HTMLContent; 
						efEntity.DocReadyEntries =  entity.DocReadyEntries; 
						efEntity.ScriptLinks =  entity.ScriptLinks; 
						efEntity.CssLinks =  entity.CssLinks; 
						efEntity.MediaSourceJSonList =  entity.MediaSourceJSonList; 
						efEntity.ClassName =  entity.ClassName; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoAppUser_Rep : Repository<InnoAppUser>
	{
		#region Ctor

		public InnoAppUser_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoAppUser,InnoAppUser>> _entityToSync = new List<Tuple<InnoAppUser,InnoAppUser>>();

		#region Methods
 				public InnoAppUser GetById(Guid id)   
		{
			return _objectSet.SingleOrDefault(e => e.Id == id);
		}
		
				
		public override InnoAppUser GetById(int id)   
		{
		 				//Implicit conversion
		return GetById(id);
				}

		public void AddUpdate(InnoAppUser entity)
		{
			InnoAppUser efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Guid))
			{
				efEntity = new InnoAppUser();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoAppUser();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoAppUser,InnoAppUser>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Application =  entity.FK_Application; 
						efEntity.CreationDate =  entity.CreationDate; 
						efEntity.Username =  entity.Username; 
						efEntity.Email =  entity.Email; 
						efEntity.Password =  entity.Password; 
						efEntity.PasswordQuestion =  entity.PasswordQuestion; 
						efEntity.PasswordAnswer =  entity.PasswordAnswer; 
						efEntity.IsApproved =  entity.IsApproved; 
						efEntity.LastActivityDate =  entity.LastActivityDate; 
						efEntity.LastLoginDate =  entity.LastLoginDate; 
						efEntity.LastPasswordChangedDate =  entity.LastPasswordChangedDate; 
						efEntity.IsOnline =  entity.IsOnline; 
						efEntity.IsLockedOut =  entity.IsLockedOut; 
						efEntity.LastLockedOutDate =  entity.LastLockedOutDate; 
						efEntity.FailedPasswordAttemptCount =  entity.FailedPasswordAttemptCount; 
						efEntity.FailedPasswordAttemptWindowStart =  entity.FailedPasswordAttemptWindowStart; 
						efEntity.FailedPasswordAnswerAttemptCount =  entity.FailedPasswordAnswerAttemptCount; 
						efEntity.FailedPasswordAnswerAttemptWindowStart =  entity.FailedPasswordAnswerAttemptWindowStart; 
						efEntity.LastModified =  entity.LastModified; 
						efEntity.Comment =  entity.Comment; 
						efEntity.IsAnonymous =  entity.IsAnonymous; 
						
			//Navigation Properties
						//efEntity.Contact =  entity.Contact; 
						//efEntity.ManagedContent =  entity.ManagedContent; 
						//efEntity.ManagedContent1 =  entity.ManagedContent1; 
						//efEntity.InnoUsersInRoles =  entity.InnoUsersInRoles; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoProfile_Rep : Repository<InnoProfile>
	{
		#region Ctor

		public InnoProfile_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoProfile,InnoProfile>> _entityToSync = new List<Tuple<InnoProfile,InnoProfile>>();

		#region Methods
 				public InnoProfile GetById(Guid id)   
		{
			return _objectSet.SingleOrDefault(e => e.Id == id);
		}
		
				
		public override InnoProfile GetById(int id)   
		{
		 				//Implicit conversion
		return GetById(id);
				}

		public void AddUpdate(InnoProfile entity)
		{
			InnoProfile efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Guid))
			{
				efEntity = new InnoProfile();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoProfile();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoProfile,InnoProfile>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.PropertyNames =  entity.PropertyNames; 
						efEntity.PropertyValuesString =  entity.PropertyValuesString; 
						efEntity.PropertyValuesBinary =  entity.PropertyValuesBinary; 
						efEntity.LastUpdatedDate =  entity.LastUpdatedDate; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoRole_Rep : Repository<InnoRole>
	{
		#region Ctor

		public InnoRole_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoRole,InnoRole>> _entityToSync = new List<Tuple<InnoRole,InnoRole>>();

		#region Methods
 				public InnoRole GetById(Guid id)   
		{
			return _objectSet.SingleOrDefault(e => e.Id == id);
		}
		
				
		public override InnoRole GetById(int id)   
		{
		 				//Implicit conversion
		return GetById(id);
				}

		public void AddUpdate(InnoRole entity)
		{
			InnoRole efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Guid))
			{
				efEntity = new InnoRole();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoRole();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoRole,InnoRole>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Application =  entity.FK_Application; 
						efEntity.Name =  entity.Name; 
						
			//Navigation Properties
						//efEntity.InnoUsersInRoles =  entity.InnoUsersInRoles; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class InnoUsersInRoles_Rep : Repository<InnoUsersInRoles>
	{
		#region Ctor

		public InnoUsersInRoles_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.FK_InnoRole = e.Item2.FK_InnoRole;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<InnoUsersInRoles,InnoUsersInRoles>> _entityToSync = new List<Tuple<InnoUsersInRoles,InnoUsersInRoles>>();

		#region Methods
 				public InnoUsersInRoles GetById(Guid id)   
		{
			return _objectSet.SingleOrDefault(e => e.FK_InnoRole == id);
		}
		
				
		public override InnoUsersInRoles GetById(int id)   
		{
		 				//Implicit conversion
		return GetById(id);
				}

		public void AddUpdate(InnoUsersInRoles entity)
		{
			InnoUsersInRoles efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.FK_InnoRole == default(Guid))
			{
				efEntity = new InnoUsersInRoles();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.FK_InnoRole);

				 if(efEntity == null)
				 {
				    efEntity =  new InnoUsersInRoles();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< InnoUsersInRoles,InnoUsersInRoles>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_InnoAppUser =  entity.FK_InnoAppUser; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.FK_InnoRole = efEntity.FK_InnoRole ; 
			
						
		}
		#endregion		
	}
	
	public partial class Language_Rep : Repository<Language>
	{
		#region Ctor

		public Language_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Language,Language>> _entityToSync = new List<Tuple<Language,Language>>();

		#region Methods
 				
		public override Language GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Language entity)
		{
			Language efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Language();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Language();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Language,Language>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						//efEntity.Contact =  entity.Contact; 
						//efEntity.LayoutMenu_Translation =  entity.LayoutMenu_Translation; 
						//efEntity.InnoAppSpecialBlockHTMLContent =  entity.InnoAppSpecialBlockHTMLContent; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class LayoutMenu_Rep : Repository<LayoutMenu>
	{
		#region Ctor

		public LayoutMenu_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<LayoutMenu,LayoutMenu>> _entityToSync = new List<Tuple<LayoutMenu,LayoutMenu>>();

		#region Methods
 				
		public override LayoutMenu GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(LayoutMenu entity)
		{
			LayoutMenu efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new LayoutMenu();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new LayoutMenu();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< LayoutMenu,LayoutMenu>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_InnoApplication =  entity.FK_InnoApplication; 
						efEntity.FK_LayoutMenu =  entity.FK_LayoutMenu; 
						efEntity.Name =  entity.Name; 
						efEntity.Controller =  entity.Controller; 
						efEntity.DefaultAction =  entity.DefaultAction; 
						efEntity.SortIndex =  entity.SortIndex; 
						efEntity.DisplayMenuToPublicIfPrivate =  entity.DisplayMenuToPublicIfPrivate; 
						efEntity.DisplayMenuBar =  entity.DisplayMenuBar; 
						
			//Navigation Properties
						//efEntity.LayoutMenu_Translation =  entity.LayoutMenu_Translation; 
						//efEntity.LayoutMenu1 =  entity.LayoutMenu1; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class LayoutMenu_Translation_Rep : Repository<LayoutMenu_Translation>
	{
		#region Ctor

		public LayoutMenu_Translation_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<LayoutMenu_Translation,LayoutMenu_Translation>> _entityToSync = new List<Tuple<LayoutMenu_Translation,LayoutMenu_Translation>>();

		#region Methods
 				
		public override LayoutMenu_Translation GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(LayoutMenu_Translation entity)
		{
			LayoutMenu_Translation efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new LayoutMenu_Translation();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new LayoutMenu_Translation();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< LayoutMenu_Translation,LayoutMenu_Translation>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_LayoutMenu =  entity.FK_LayoutMenu; 
						efEntity.FK_Language =  entity.FK_Language; 
						efEntity.Active =  entity.Active; 
						efEntity.MenuNameURLFormatted =  entity.MenuNameURLFormatted; 
						efEntity.ButtonCaption =  entity.ButtonCaption; 
						efEntity.ButtonToolTip =  entity.ButtonToolTip; 
						efEntity.CssClass =  entity.CssClass; 
						
			//Navigation Properties
						//efEntity.Structure_Page =  entity.Structure_Page; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class ManagedContent_Rep : Repository<ManagedContent>
	{
		#region Ctor

		public ManagedContent_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<ManagedContent,ManagedContent>> _entityToSync = new List<Tuple<ManagedContent,ManagedContent>>();

		#region Methods
 				
		public override ManagedContent GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(ManagedContent entity)
		{
			ManagedContent efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new ManagedContent();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new ManagedContent();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< ManagedContent,ManagedContent>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Structure_Page =  entity.FK_Structure_Page; 
						efEntity.FK_AppUser_Creator =  entity.FK_AppUser_Creator; 
						efEntity.FK_AppUser_LastModificator =  entity.FK_AppUser_LastModificator; 
						efEntity.Creation =  entity.Creation; 
						efEntity.LastUpdate =  entity.LastUpdate; 
						efEntity.ResumeText =  entity.ResumeText; 
						efEntity.ResumeHTML =  entity.ResumeHTML; 
						efEntity.ContentText =  entity.ContentText; 
						efEntity.ContentHTML =  entity.ContentHTML; 
						efEntity.CSSExtension =  entity.CSSExtension; 
						efEntity.JSExtension =  entity.JSExtension; 
						
			//Navigation Properties
						//efEntity.Article =  entity.Article; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Order_Rep : Repository<Order>
	{
		#region Ctor

		public Order_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Order,Order>> _entityToSync = new List<Tuple<Order,Order>>();

		#region Methods
 				
		public override Order GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Order entity)
		{
			Order efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Order();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Order();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Order,Order>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_DeliveryMode =  entity.FK_DeliveryMode; 
						efEntity.FK_Contact =  entity.FK_Contact; 
						efEntity.DeliveryAddress =  entity.DeliveryAddress; 
						efEntity.InvoiceAddress =  entity.InvoiceAddress; 
						efEntity.OrderRef =  entity.OrderRef; 
						efEntity.OrderDate =  entity.OrderDate; 
						efEntity.PackageCount =  entity.PackageCount; 
						efEntity.ExclusiveOfTaxeTotal =  entity.ExclusiveOfTaxeTotal; 
						efEntity.VATAmount =  entity.VATAmount; 
						efEntity.AllTaxeInclusiveTotal =  entity.AllTaxeInclusiveTotal; 
						efEntity.IsDraft =  entity.IsDraft; 
						
			//Navigation Properties
						//efEntity.OrderDetail =  entity.OrderDetail; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class OrderDetail_Rep : Repository<OrderDetail>
	{
		#region Ctor

		public OrderDetail_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<OrderDetail,OrderDetail>> _entityToSync = new List<Tuple<OrderDetail,OrderDetail>>();

		#region Methods
 				
		public override OrderDetail GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(OrderDetail entity)
		{
			OrderDetail efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new OrderDetail();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new OrderDetail();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< OrderDetail,OrderDetail>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Order =  entity.FK_Order; 
						efEntity.FK_Product =  entity.FK_Product; 
						efEntity.ProductDescription =  entity.ProductDescription; 
						efEntity.Quantity =  entity.Quantity; 
						efEntity.UnitPrice =  entity.UnitPrice; 
						efEntity.AppliedVATRate =  entity.AppliedVATRate; 
						efEntity.TotalPrice =  entity.TotalPrice; 
						efEntity.VatTotal =  entity.VatTotal; 
						efEntity.AllTaxeIncludedTotal =  entity.AllTaxeIncludedTotal; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Product_Rep : Repository<Product>
	{
		#region Ctor

		public Product_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Product,Product>> _entityToSync = new List<Tuple<Product,Product>>();

		#region Methods
 				
		public override Product GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Product entity)
		{
			Product efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Product();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Product();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Product,Product>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_VAT =  entity.FK_VAT; 
						efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						efEntity.UnitPrice =  entity.UnitPrice; 
						efEntity.Picture =  entity.Picture; 
						
			//Navigation Properties
						//efEntity.OrderDetail =  entity.OrderDetail; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class Structure_Page_Rep : Repository<Structure_Page>
	{
		#region Ctor

		public Structure_Page_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<Structure_Page,Structure_Page>> _entityToSync = new List<Tuple<Structure_Page,Structure_Page>>();

		#region Methods
 				
		public override Structure_Page GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(Structure_Page entity)
		{
			Structure_Page efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new Structure_Page();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new Structure_Page();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< Structure_Page,Structure_Page>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_InnoApplication =  entity.FK_InnoApplication; 
						efEntity.FK_LayoutMenu_Translation =  entity.FK_LayoutMenu_Translation; 
						efEntity.DirectURL =  entity.DirectURL; 
						efEntity.PageNameURLFormatted =  entity.PageNameURLFormatted; 
						efEntity.Title =  entity.Title; 
						efEntity.Description =  entity.Description; 
						efEntity.Keywords =  entity.Keywords; 
						efEntity.RevisitAfter =  entity.RevisitAfter; 
						efEntity.Robots =  entity.Robots; 
						efEntity.ReadyToPublish =  entity.ReadyToPublish; 
						efEntity.IndexingCategory =  entity.IndexingCategory; 
						efEntity.IsActive =  entity.IsActive; 
						efEntity.PublicationDate =  entity.PublicationDate; 
						efEntity.LastBuildDate =  entity.LastBuildDate; 
						efEntity.DateVersion =  entity.DateVersion; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						//efEntity.ManagedContent =  entity.ManagedContent; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class TelecomType_Rep : Repository<TelecomType>
	{
		#region Ctor

		public TelecomType_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<TelecomType,TelecomType>> _entityToSync = new List<Tuple<TelecomType,TelecomType>>();

		#region Methods
 				
		public override TelecomType GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(TelecomType entity)
		{
			TelecomType efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new TelecomType();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new TelecomType();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< TelecomType,TelecomType>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						
			//Navigation Properties
						//efEntity.Contact_TelecomType =  entity.Contact_TelecomType; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_AdminRoles_Rep : Repository<v_AdminRoles>
	{
		#region Ctor

		public v_AdminRoles_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_AdminRoles,v_AdminRoles>> _entityToSync = new List<Tuple<v_AdminRoles,v_AdminRoles>>();

		#region Methods
 				public v_AdminRoles GetById(Guid id)   
		{
			return _objectSet.SingleOrDefault(e => e.Id == id);
		}
		
				
		public override v_AdminRoles GetById(int id)   
		{
		 				//Implicit conversion
		return GetById(id);
				}

		public void AddUpdate(v_AdminRoles entity)
		{
			v_AdminRoles efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Guid))
			{
				efEntity = new v_AdminRoles();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new v_AdminRoles();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_AdminRoles,v_AdminRoles>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.FK_Application =  entity.FK_Application; 
						efEntity.Name =  entity.Name; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_AdminUsers_Rep : Repository<v_AdminUsers>
	{
		#region Ctor

		public v_AdminUsers_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.UserId = e.Item2.UserId;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_AdminUsers,v_AdminUsers>> _entityToSync = new List<Tuple<v_AdminUsers,v_AdminUsers>>();

		#region Methods
 				public v_AdminUsers GetById(Guid id)   
		{
			return _objectSet.SingleOrDefault(e => e.UserId == id);
		}
		
				
		public override v_AdminUsers GetById(int id)   
		{
		 				//Implicit conversion
		return GetById(id);
				}

		public void AddUpdate(v_AdminUsers entity)
		{
			v_AdminUsers efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.UserId == default(Guid))
			{
				efEntity = new v_AdminUsers();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.UserId);

				 if(efEntity == null)
				 {
				    efEntity =  new v_AdminUsers();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_AdminUsers,v_AdminUsers>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.ContactId =  entity.ContactId; 
						efEntity.FavoriteLanguage =  entity.FavoriteLanguage; 
						efEntity.Username =  entity.Username; 
						efEntity.Email =  entity.Email; 
						efEntity.IsApproved =  entity.IsApproved; 
						efEntity.IsOnline =  entity.IsOnline; 
						efEntity.IsLockedOut =  entity.IsLockedOut; 
						efEntity.GenreId =  entity.GenreId; 
						efEntity.Genre =  entity.Genre; 
						efEntity.FirstName =  entity.FirstName; 
						efEntity.LastName =  entity.LastName; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.UserId = efEntity.UserId ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_Competencies_Rep : Repository<v_Competencies>
	{
		#region Ctor

		public v_Competencies_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_Competencies,v_Competencies>> _entityToSync = new List<Tuple<v_Competencies,v_Competencies>>();

		#region Methods
 				
		public override v_Competencies GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(v_Competencies entity)
		{
			v_Competencies efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new v_Competencies();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new v_Competencies();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_Competencies,v_Competencies>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_ContactAddresses_Rep : Repository<v_ContactAddresses>
	{
		#region Ctor

		public v_ContactAddresses_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_ContactAddresses,v_ContactAddresses>> _entityToSync = new List<Tuple<v_ContactAddresses,v_ContactAddresses>>();

		#region Methods
 				
		public override v_ContactAddresses GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(v_ContactAddresses entity)
		{
			v_ContactAddresses efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new v_ContactAddresses();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new v_ContactAddresses();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_ContactAddresses,v_ContactAddresses>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.UserId =  entity.UserId; 
						efEntity.ContactId =  entity.ContactId; 
						efEntity.AddressLabel =  entity.AddressLabel; 
						efEntity.Town =  entity.Town; 
						efEntity.Country =  entity.Country; 
						efEntity.IsCorrespondence =  entity.IsCorrespondence; 
						efEntity.IsBilling =  entity.IsBilling; 
						efEntity.IsDelivery =  entity.IsDelivery; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_ContactCompetencies_Rep : Repository<v_ContactCompetencies>
	{
		#region Ctor

		public v_ContactCompetencies_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_ContactCompetencies,v_ContactCompetencies>> _entityToSync = new List<Tuple<v_ContactCompetencies,v_ContactCompetencies>>();

		#region Methods
 				
		public override v_ContactCompetencies GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(v_ContactCompetencies entity)
		{
			v_ContactCompetencies efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new v_ContactCompetencies();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new v_ContactCompetencies();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_ContactCompetencies,v_ContactCompetencies>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.UserId =  entity.UserId; 
						efEntity.FK_Contact =  entity.FK_Contact; 
						efEntity.CompetencyName =  entity.CompetencyName; 
						efEntity.YearsOfExperience =  entity.YearsOfExperience; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_Contacts_Rep : Repository<v_Contacts>
	{
		#region Ctor

		public v_Contacts_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.ContactId = e.Item2.ContactId;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_Contacts,v_Contacts>> _entityToSync = new List<Tuple<v_Contacts,v_Contacts>>();

		#region Methods
 				
		public override v_Contacts GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.ContactId == id);
				}

		public void AddUpdate(v_Contacts entity)
		{
			v_Contacts efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.ContactId == default(Int32))
			{
				efEntity = new v_Contacts();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.ContactId);

				 if(efEntity == null)
				 {
				    efEntity =  new v_Contacts();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_Contacts,v_Contacts>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.UserId =  entity.UserId; 
						efEntity.Genre =  entity.Genre; 
						efEntity.FirstName =  entity.FirstName; 
						efEntity.LastName =  entity.LastName; 
						efEntity.Username =  entity.Username; 
						efEntity.Town =  entity.Town; 
						efEntity.Country =  entity.Country; 
						efEntity.Email =  entity.Email; 
						efEntity.IconPath =  entity.IconPath; 
						efEntity.UTCoffset =  entity.UTCoffset; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.ContactId = efEntity.ContactId ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_ContactTelecoms_Rep : Repository<v_ContactTelecoms>
	{
		#region Ctor

		public v_ContactTelecoms_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_ContactTelecoms,v_ContactTelecoms>> _entityToSync = new List<Tuple<v_ContactTelecoms,v_ContactTelecoms>>();

		#region Methods
 				
		public override v_ContactTelecoms GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(v_ContactTelecoms entity)
		{
			v_ContactTelecoms efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new v_ContactTelecoms();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new v_ContactTelecoms();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_ContactTelecoms,v_ContactTelecoms>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.UserId =  entity.UserId; 
						efEntity.FK_Contact =  entity.FK_Contact; 
						efEntity.TelecomType =  entity.TelecomType; 
						efEntity.Value =  entity.Value; 
						efEntity.SortIndex =  entity.SortIndex; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class v_TelecomTypes_Rep : Repository<v_TelecomTypes>
	{
		#region Ctor

		public v_TelecomTypes_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<v_TelecomTypes,v_TelecomTypes>> _entityToSync = new List<Tuple<v_TelecomTypes,v_TelecomTypes>>();

		#region Methods
 				
		public override v_TelecomTypes GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(v_TelecomTypes entity)
		{
			v_TelecomTypes efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new v_TelecomTypes();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new v_TelecomTypes();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< v_TelecomTypes,v_TelecomTypes>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Name =  entity.Name; 
						efEntity.Description =  entity.Description; 
						
			//Navigation Properties
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	
	public partial class VAT_Rep : Repository<VAT>
	{
		#region Ctor

		public VAT_Rep(DataRepositories dataRepository)
   			: base(dataRepository)
		{
		}
		
		
		protected override void OnSave(object sender, EventArgs arg)
		{
		     foreach(var e in _entityToSync)
			 {
			 	e.Item1.Id = e.Item2.Id;
			 }
			 
			 _entityToSync.Clear();
		}

    	#endregion

		//used to cache entities that have been added or updated using AddUpdate()
		//This will update the 
		List<Tuple<VAT,VAT>> _entityToSync = new List<Tuple<VAT,VAT>>();

		#region Methods
 				
		public override VAT GetById(int id)   
		{
		 					return _objectSet.SingleOrDefault(e => e.Id == id);
				}

		public void AddUpdate(VAT entity)
		{
			VAT efEntity = null;
			/*/check if id equals zero (or null, depending on the type)
			if(entity.Id == default(Int32))
			{
				efEntity = new VAT();
				_objectSet.AddObject(efEntity);
			}else //id is not zero, so it should already exist in the repository
			{*/
				 efEntity = GetById(entity.Id);

				 if(efEntity == null)
				 {
				    efEntity =  new VAT();
					_objectSet.AddObject(efEntity);
					_entityToSync.Add(new Tuple< VAT,VAT>(entity, efEntity));
				 }else if(efEntity == entity) 
				 return; //if the submitted entity is the real entity used by EF, we don't need to map anything
			//}

			//copy values
					efEntity.Value =  entity.Value; 
						efEntity.Description =  entity.Description; 
						
			//Navigation Properties
						//efEntity.Product =  entity.Product; 
						
				//id is set by DB
			entity.Id = efEntity.Id ; 
			
						
		}
		#endregion		
	}
	

  public partial class DataRepositories
  {

     internal ObjectContext _context;

      internal event EventHandler Saved;
	  
	  public void Save() 
	  {
		_context.SaveChanges();
		if(Saved != null)
		{
			Saved(this, EventArgs.Empty);
		}
	  }
	  
	  
	  
	#region _repositories private fields
	  	private AddressType_Rep _AddressType_Rep;
		private Article_Rep _Article_Rep;
		private ArticleComment_Rep _ArticleComment_Rep;
		private CalendarTimeZones_Rep _CalendarTimeZones_Rep;
		private Competency_Rep _Competency_Rep;
		private Contact_Rep _Contact_Rep;
		private Contact_Competency_Rep _Contact_Competency_Rep;
		private Contact_ContactAddress_Rep _Contact_ContactAddress_Rep;
		private Contact_ContactAddress_AddressType_Rep _Contact_ContactAddress_AddressType_Rep;
		private Contact_TelecomType_Rep _Contact_TelecomType_Rep;
		private ContactAddress_Rep _ContactAddress_Rep;
		private DeliveryMode_Rep _DeliveryMode_Rep;
		private Genre_Rep _Genre_Rep;
		private IndexingCategory_Rep _IndexingCategory_Rep;
		private InnoAppDynamicSetting_Rep _InnoAppDynamicSetting_Rep;
		private InnoApplication_Rep _InnoApplication_Rep;
		private InnoAppSettings_Rep _InnoAppSettings_Rep;
		private InnoAppSpecialBlockHTMLContent_Rep _InnoAppSpecialBlockHTMLContent_Rep;
		private InnoAppUser_Rep _InnoAppUser_Rep;
		private InnoProfile_Rep _InnoProfile_Rep;
		private InnoRole_Rep _InnoRole_Rep;
		private InnoUsersInRoles_Rep _InnoUsersInRoles_Rep;
		private Language_Rep _Language_Rep;
		private LayoutMenu_Rep _LayoutMenu_Rep;
		private LayoutMenu_Translation_Rep _LayoutMenu_Translation_Rep;
		private ManagedContent_Rep _ManagedContent_Rep;
		private Order_Rep _Order_Rep;
		private OrderDetail_Rep _OrderDetail_Rep;
		private Product_Rep _Product_Rep;
		private Structure_Page_Rep _Structure_Page_Rep;
		private TelecomType_Rep _TelecomType_Rep;
		private v_AdminRoles_Rep _v_AdminRoles_Rep;
		private v_AdminUsers_Rep _v_AdminUsers_Rep;
		private v_Competencies_Rep _v_Competencies_Rep;
		private v_ContactAddresses_Rep _v_ContactAddresses_Rep;
		private v_ContactCompetencies_Rep _v_ContactCompetencies_Rep;
		private v_Contacts_Rep _v_Contacts_Rep;
		private v_ContactTelecoms_Rep _v_ContactTelecoms_Rep;
		private v_TelecomTypes_Rep _v_TelecomTypes_Rep;
		private VAT_Rep _VAT_Rep;
		#endregion
	
	#region repositories properties
		    
		public AddressType_Rep AddressType_Rep
		{
			get
			{
				if(_AddressType_Rep == null) _AddressType_Rep = new AddressType_Rep(this);
				 return _AddressType_Rep;
			}
		}
		    
		public Article_Rep Article_Rep
		{
			get
			{
				if(_Article_Rep == null) _Article_Rep = new Article_Rep(this);
				 return _Article_Rep;
			}
		}
		    
		public ArticleComment_Rep ArticleComment_Rep
		{
			get
			{
				if(_ArticleComment_Rep == null) _ArticleComment_Rep = new ArticleComment_Rep(this);
				 return _ArticleComment_Rep;
			}
		}
		    
		public CalendarTimeZones_Rep CalendarTimeZones_Rep
		{
			get
			{
				if(_CalendarTimeZones_Rep == null) _CalendarTimeZones_Rep = new CalendarTimeZones_Rep(this);
				 return _CalendarTimeZones_Rep;
			}
		}
		    
		public Competency_Rep Competency_Rep
		{
			get
			{
				if(_Competency_Rep == null) _Competency_Rep = new Competency_Rep(this);
				 return _Competency_Rep;
			}
		}
		    
		public Contact_Rep Contact_Rep
		{
			get
			{
				if(_Contact_Rep == null) _Contact_Rep = new Contact_Rep(this);
				 return _Contact_Rep;
			}
		}
		    
		public Contact_Competency_Rep Contact_Competency_Rep
		{
			get
			{
				if(_Contact_Competency_Rep == null) _Contact_Competency_Rep = new Contact_Competency_Rep(this);
				 return _Contact_Competency_Rep;
			}
		}
		    
		public Contact_ContactAddress_Rep Contact_ContactAddress_Rep
		{
			get
			{
				if(_Contact_ContactAddress_Rep == null) _Contact_ContactAddress_Rep = new Contact_ContactAddress_Rep(this);
				 return _Contact_ContactAddress_Rep;
			}
		}
		    
		public Contact_ContactAddress_AddressType_Rep Contact_ContactAddress_AddressType_Rep
		{
			get
			{
				if(_Contact_ContactAddress_AddressType_Rep == null) _Contact_ContactAddress_AddressType_Rep = new Contact_ContactAddress_AddressType_Rep(this);
				 return _Contact_ContactAddress_AddressType_Rep;
			}
		}
		    
		public Contact_TelecomType_Rep Contact_TelecomType_Rep
		{
			get
			{
				if(_Contact_TelecomType_Rep == null) _Contact_TelecomType_Rep = new Contact_TelecomType_Rep(this);
				 return _Contact_TelecomType_Rep;
			}
		}
		    
		public ContactAddress_Rep ContactAddress_Rep
		{
			get
			{
				if(_ContactAddress_Rep == null) _ContactAddress_Rep = new ContactAddress_Rep(this);
				 return _ContactAddress_Rep;
			}
		}
		    
		public DeliveryMode_Rep DeliveryMode_Rep
		{
			get
			{
				if(_DeliveryMode_Rep == null) _DeliveryMode_Rep = new DeliveryMode_Rep(this);
				 return _DeliveryMode_Rep;
			}
		}
		    
		public Genre_Rep Genre_Rep
		{
			get
			{
				if(_Genre_Rep == null) _Genre_Rep = new Genre_Rep(this);
				 return _Genre_Rep;
			}
		}
		    
		public IndexingCategory_Rep IndexingCategory_Rep
		{
			get
			{
				if(_IndexingCategory_Rep == null) _IndexingCategory_Rep = new IndexingCategory_Rep(this);
				 return _IndexingCategory_Rep;
			}
		}
		    
		public InnoAppDynamicSetting_Rep InnoAppDynamicSetting_Rep
		{
			get
			{
				if(_InnoAppDynamicSetting_Rep == null) _InnoAppDynamicSetting_Rep = new InnoAppDynamicSetting_Rep(this);
				 return _InnoAppDynamicSetting_Rep;
			}
		}
		    
		public InnoApplication_Rep InnoApplication_Rep
		{
			get
			{
				if(_InnoApplication_Rep == null) _InnoApplication_Rep = new InnoApplication_Rep(this);
				 return _InnoApplication_Rep;
			}
		}
		    
		public InnoAppSettings_Rep InnoAppSettings_Rep
		{
			get
			{
				if(_InnoAppSettings_Rep == null) _InnoAppSettings_Rep = new InnoAppSettings_Rep(this);
				 return _InnoAppSettings_Rep;
			}
		}
		    
		public InnoAppSpecialBlockHTMLContent_Rep InnoAppSpecialBlockHTMLContent_Rep
		{
			get
			{
				if(_InnoAppSpecialBlockHTMLContent_Rep == null) _InnoAppSpecialBlockHTMLContent_Rep = new InnoAppSpecialBlockHTMLContent_Rep(this);
				 return _InnoAppSpecialBlockHTMLContent_Rep;
			}
		}
		    
		public InnoAppUser_Rep InnoAppUser_Rep
		{
			get
			{
				if(_InnoAppUser_Rep == null) _InnoAppUser_Rep = new InnoAppUser_Rep(this);
				 return _InnoAppUser_Rep;
			}
		}
		    
		public InnoProfile_Rep InnoProfile_Rep
		{
			get
			{
				if(_InnoProfile_Rep == null) _InnoProfile_Rep = new InnoProfile_Rep(this);
				 return _InnoProfile_Rep;
			}
		}
		    
		public InnoRole_Rep InnoRole_Rep
		{
			get
			{
				if(_InnoRole_Rep == null) _InnoRole_Rep = new InnoRole_Rep(this);
				 return _InnoRole_Rep;
			}
		}
		    
		public InnoUsersInRoles_Rep InnoUsersInRoles_Rep
		{
			get
			{
				if(_InnoUsersInRoles_Rep == null) _InnoUsersInRoles_Rep = new InnoUsersInRoles_Rep(this);
				 return _InnoUsersInRoles_Rep;
			}
		}
		    
		public Language_Rep Language_Rep
		{
			get
			{
				if(_Language_Rep == null) _Language_Rep = new Language_Rep(this);
				 return _Language_Rep;
			}
		}
		    
		public LayoutMenu_Rep LayoutMenu_Rep
		{
			get
			{
				if(_LayoutMenu_Rep == null) _LayoutMenu_Rep = new LayoutMenu_Rep(this);
				 return _LayoutMenu_Rep;
			}
		}
		    
		public LayoutMenu_Translation_Rep LayoutMenu_Translation_Rep
		{
			get
			{
				if(_LayoutMenu_Translation_Rep == null) _LayoutMenu_Translation_Rep = new LayoutMenu_Translation_Rep(this);
				 return _LayoutMenu_Translation_Rep;
			}
		}
		    
		public ManagedContent_Rep ManagedContent_Rep
		{
			get
			{
				if(_ManagedContent_Rep == null) _ManagedContent_Rep = new ManagedContent_Rep(this);
				 return _ManagedContent_Rep;
			}
		}
		    
		public Order_Rep Order_Rep
		{
			get
			{
				if(_Order_Rep == null) _Order_Rep = new Order_Rep(this);
				 return _Order_Rep;
			}
		}
		    
		public OrderDetail_Rep OrderDetail_Rep
		{
			get
			{
				if(_OrderDetail_Rep == null) _OrderDetail_Rep = new OrderDetail_Rep(this);
				 return _OrderDetail_Rep;
			}
		}
		    
		public Product_Rep Product_Rep
		{
			get
			{
				if(_Product_Rep == null) _Product_Rep = new Product_Rep(this);
				 return _Product_Rep;
			}
		}
		    
		public Structure_Page_Rep Structure_Page_Rep
		{
			get
			{
				if(_Structure_Page_Rep == null) _Structure_Page_Rep = new Structure_Page_Rep(this);
				 return _Structure_Page_Rep;
			}
		}
		    
		public TelecomType_Rep TelecomType_Rep
		{
			get
			{
				if(_TelecomType_Rep == null) _TelecomType_Rep = new TelecomType_Rep(this);
				 return _TelecomType_Rep;
			}
		}
		    
		public v_AdminRoles_Rep v_AdminRoles_Rep
		{
			get
			{
				if(_v_AdminRoles_Rep == null) _v_AdminRoles_Rep = new v_AdminRoles_Rep(this);
				 return _v_AdminRoles_Rep;
			}
		}
		    
		public v_AdminUsers_Rep v_AdminUsers_Rep
		{
			get
			{
				if(_v_AdminUsers_Rep == null) _v_AdminUsers_Rep = new v_AdminUsers_Rep(this);
				 return _v_AdminUsers_Rep;
			}
		}
		    
		public v_Competencies_Rep v_Competencies_Rep
		{
			get
			{
				if(_v_Competencies_Rep == null) _v_Competencies_Rep = new v_Competencies_Rep(this);
				 return _v_Competencies_Rep;
			}
		}
		    
		public v_ContactAddresses_Rep v_ContactAddresses_Rep
		{
			get
			{
				if(_v_ContactAddresses_Rep == null) _v_ContactAddresses_Rep = new v_ContactAddresses_Rep(this);
				 return _v_ContactAddresses_Rep;
			}
		}
		    
		public v_ContactCompetencies_Rep v_ContactCompetencies_Rep
		{
			get
			{
				if(_v_ContactCompetencies_Rep == null) _v_ContactCompetencies_Rep = new v_ContactCompetencies_Rep(this);
				 return _v_ContactCompetencies_Rep;
			}
		}
		    
		public v_Contacts_Rep v_Contacts_Rep
		{
			get
			{
				if(_v_Contacts_Rep == null) _v_Contacts_Rep = new v_Contacts_Rep(this);
				 return _v_Contacts_Rep;
			}
		}
		    
		public v_ContactTelecoms_Rep v_ContactTelecoms_Rep
		{
			get
			{
				if(_v_ContactTelecoms_Rep == null) _v_ContactTelecoms_Rep = new v_ContactTelecoms_Rep(this);
				 return _v_ContactTelecoms_Rep;
			}
		}
		    
		public v_TelecomTypes_Rep v_TelecomTypes_Rep
		{
			get
			{
				if(_v_TelecomTypes_Rep == null) _v_TelecomTypes_Rep = new v_TelecomTypes_Rep(this);
				 return _v_TelecomTypes_Rep;
			}
		}
		    
		public VAT_Rep VAT_Rep
		{
			get
			{
				if(_VAT_Rep == null) _VAT_Rep = new VAT_Rep(this);
				 return _VAT_Rep;
			}
		}
		#endregion
  }
	
		
  
}
